//
//  DiUtil.h
//  DooiooOnline
//
//  Created by koki on 14-11-6.
//  Copyright (c) 2014年 dooioo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import<CoreText/CoreText.h>

@interface HDUtil : NSObject

//检查电话号码是否合法
+(BOOL)checkPhoneNumInput:(NSString *)number;

//验证手机
+(BOOL)checkMoblieNumber:(NSString *)number;

//验证姓名
+(BOOL)checkName:(NSString *)name;

//验证身份证号
+(BOOL)checkIdCardNo:(NSString *)idCard;

//验证价格
+(BOOL)checkPrice:(NSString *)price;

//验证银行卡
+(BOOL)checkBankCardId:(NSString *)bankCardId;

//验证密码
+(BOOL)checkPassword:(NSString *)password;

//创建指定字窜的Label
+(UILabel*)UILabelWithText:(NSString*)text fontSize:(int)fontSize;
+(UILabel*)UILabelWithText:(NSString*)text boldFontSize:(int)fontSize;
+(UIButton*)buttonWithTitle:(NSString*)title frame:(CGRect)rect;
//获取字符窜大小
+(CGSize)getSizeWithText:(NSString*)text fontSize:(int)fontSize;
+(CGSize)getSizeWithText:(NSString*)text font:(UIFont*)font;
+(CGSize)getSizeWithText:(NSString*)text boldfontSize:(int)fontSize;
+(CGSize)sizeWithString:(NSString*) string  font:(UIFont*)font size:(CGSize)size;
+(CGSize)sizeWithString:(NSString*) string  attribute:(NSDictionary*)attribute size:(CGSize)size;
+(float)heightForTextViewSize:(CGSize)size  WithText: (NSString *) strText font:(UIFont*)font;
//获取NSAttributed字符窜大小
+(CGSize)sizeWithString:(NSAttributedString*) attrStr size:(CGSize)size;

//按宽度获取图片合适尺寸
+ (CGSize)newSizeByOriginalSize:(CGSize)oldSize maxSize:(CGSize)mSize newWidth:(float)newWidth;

//MD5加密
+(NSString *)MD5:(NSString *)str;
//计算距今天数
+(int)calculateDaysFromDate:(NSDate*)date;
//字符串转化成时间
+(NSDate*)getDateFromeString:(NSString*)str;
//将时间转化成字符串
+(NSString*)formatter:(NSString*) formattter FromeDate:(NSDate*)date;

+(NSString*)formatter:(NSString*) formattter FromTime:(double)time;

//将时间字符串转化成特定格式的字符串
+(NSString*)formatter:(NSString*) formattter FromeDateStr:(NSString*)str;

//字符串转化
+(NSString*)check:(NSObject*)data;

+(NSArray*)checkArray:(NSArray*)array;
+(NSArray*)checkNilArray:(NSArray*)array;

//校检NSNumber
+(NSNumber*)checkNumber:(NSNumber*)num;
//校检NSData
+(NSData*)checkData:(NSData*)value;
//添加分位符
+(NSString*)numberFormatterDecimalStyle:(NSNumber*)data;
//四舍五入
+(NSString*)strNumberRound:(NSObject*)data;

//电话
+(BOOL)call:(NSString *)phoneNumber;

+(NSString*)clearSpaces:(NSString*)str;
//获取当前版本
+(NSString *)currentVersion;
//隐藏键盘
+(void)hidenKeyBoard;
//提示弹出
+(void)showTipAlertWithMsg:(NSString*)msg;

+(BOOL)isValidateEmail:(NSString *)email;

//删除本地数据库图片缓存
+(void)deleteImageCache;
@end














